home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr10 / inter35c.zip / WINHELP.ZIP / FIL2RTF.AWK < prev    next >
Text File  |  1993-02-08  |  2KB  |  63 lines

  1.  
  2.  
  3. BEGIN{
  4.   printf("{\\rtf\n")
  5.   printf("{\\fonttbl\n")
  6.   printf("\\f0\\froman Times New Roman;\n")
  7.   printf("\\f1\\fdecor Courier New;\n")
  8.   printf("\\f3\\fswiss Arial;\n")
  9. #  printf("\\f4\\fnil Monospaced;}\n")          # better than terminal
  10.   printf("\\f4\\fmodern Terminal;}\n")
  11.   printf("\\deff4 \n")
  12.   str1 = "}\n\\par\n\\pard\\plain\\tx1173\\tx2346\\tx3519\\tx4692\\tx5866\\tx5876\n\\fs20"
  13.   count = 00002
  14. # 2 so that hc reports same topic numbers
  15.  
  16.  
  17. }
  18. {
  19. line = $0
  20.  
  21. if ($1 ~ /.freeze/) { next; };
  22.  
  23. if ($1 ~ /\\i\\p\\aUp/) { next };
  24.  
  25. if ($1 ~ /--/) { next };
  26.  
  27. if ($1 ~ /───/) { next };
  28.  
  29. if ($1 ~ /.context/) { sub("@IL", "_IL", $2); printf("\\pard\\plain\\page\n#{\\footnote  _%sZ }\n+{\\footnote %s:%-4.4d}\n", $2, lev, count++); next };
  30.  
  31. if ($1 ~ /.topic/) { printf( "${\\footnote %-3.3dL}\nK{\\footnote %s%s", count, substr($0,7), str1); next };
  32. # The line below produces produces intelligible titles but file size grows and
  33. # hc must run in OS/2 because of memory requirements
  34. # if ($1 ~ /.topic/) { printf( "${\\footnote %s}\nK{\\footnote %s%s", substr($0,7), substr($0,7), str1); next };
  35.  
  36. if (($0 ~ /\\b/) && ($0 ~ /\\p/)) { sub("\\\\b", "{\\b ", line); sub("\\\p", " }", line); };
  37.  
  38. gsub("\\\\a\\\i...", "{\\uldb ", line);
  39. sub("\\\\v",    " }{\\v _"      , line);
  40. sub("\\\\v\\\i...",    "Z}"      , line);
  41. gsub("@IL", "_IL", line);
  42. gsub("\t\t\t\t ", "\\tab\\tab\\tab\\tab ", line);
  43. gsub("\t\t\t ", "\\tab\\tab\\tab ", line);
  44. gsub("\t\t ", "\\tab\\tab ", line);
  45. gsub("\t ", "\\tab ", line);
  46. gsub("\t\t\t\t", "\\tab\\tab\\tab\\tab ", line);
  47. gsub("\t\t\t", "\\tab\\tab\\tab ", line);
  48. gsub("\t\t", "\\tab\\tab ", line);
  49. gsub("\t", "\\tab ", line);
  50. sub("^                            ", "\\tab\\tab\\tab ", line);
  51. sub("^                   ", "\\tab\\tab ", line);
  52. sub("^          ", "\\tab ", line);
  53.  
  54. # hc 3.1 does not allow all chars... newer than inter33 migth contain more
  55. gsub("\é", "e", line);
  56. gsub("\ó", "o", line);
  57.  
  58. print line "\par "
  59. }
  60. END {
  61.   printf("{\\plain \\page}\n}\n")
  62. }
  63.